<?php
	include "../../public/commom/config.php";
	include "../lock2.php";
	include "../../public/commom/commom.php";
	
	if($_GET) {
		$id = $_GET["id"];
		$img = $_GET["img"];
		$isrc = $uploadPath . $img;
		$tsrc = $uploadPathThumb . $img;
		
		$sql = "DELETE FROM advert WHERE id = $id";
	
		$result = mysqli_query($conn, $sql);
		
		unlink($isrc);
		unlink($tsrc);
		
		mysqli_close($conn);
	
		header("Location: ./index.php");
	}
?>